package per.ace.configuration.demo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Profile;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Component;

/**
 * @program: springbootDemo
 * @description: 启动监听类
 * @author: ace
 * @Date: 2019-12-29 15:22
 **/
@Component
@Profile("test")
public class StartupListener implements ApplicationListener<ContextRefreshedEvent> {
    @Value("${height}")
    public String height;
    @Override
    public void onApplicationEvent(ContextRefreshedEvent contextRefreshedEvent) {
        System.out.println("启动完毕,读取的配置:"+height);
    }
}
